<template>
	<view class="content">
		<view class="item" v-for="item,index in itemList" :key="index"
			v-if="!((standing == 2 || standing == 3) && item.value == 'store_name' && type == 'out' && (aimType == 3 || aimType == 2  || aimType == 5))">
			<view class="item-title">{{item.label}}</view>
			<view class="item-rig" v-if="item.value !== 'sku_images' ">
				<view class="item-text" v-if="Boolean(orderData[item.value])">{{orderData[item.value]}}</view>
				<view class="item-tag" v-else>{{item.failValue}}</view>
			</view>
			<view class="item-rig" v-else>
				<view class="" v-if="orderData.sku_images.length">
					<image v-for="(items,indexs) in orderData.sku_images" :key="indexs" class="item-img" :src="items"
						mode="" @click="previewImage(indexs)"></image>
				</view>
				<view class="item-tag" v-else>{{item.failValue}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			orderData: Object,
			type: String,
			aimType: String,
		},
		// {
		// 	label: this.type == "into" ?
		// 		(this.aimType == "3" ? this.$t("express.store_name.into.aim3") :
		// 			(this.aimType == "2" ? this.$t("express.store_name.into.aim2") : this.$t(
		// 				"express.store_name.into.aim1"))) : (this.aimType == "3" ? this.$t(
		// 				"express.store_name.out.aim2") :
		// 			this.aimType == 2 ? this.$t("express.store_name.out.aim1") : (this.aimType == 4 ?
		// 				this.$t("express.store_name.out.aim4") : this.$t("express.store_name.out.aim3"))),
		// 	value: "store_name",
		// 	failValue: this.aimType == "3" ?
		// 		this.$t("express.please_store_name.out.aim2") : (this.aimType == "2" ? this.$t(
		// 			"express.please_store_name.out.aim1") : (this
		// 			.aimType ==
		// 			1 ? this.$t("express.please_store_name.into.aim1") : (this.aimType == 4 ?
		// 				this.$t("express.please_store_name.out.aim4") : this.$t(
		// 					"express.please_store_name.out.aim3"))))
		// },
		data() {
			return {
				itemList: [
					{
						label: this.$t("express.goods_code"),
						value: "goods_code",
						failValue: this.$t("express.please_goods_code")
					},
					// 删除name
					// {
					// 	label: this.$t("express.goods_title"),
					// 	value: "goods_title",
					// 	failValue: this.$t("express.please_goods_title")
					// },
					{
						label: this.$t("express.sku_images"),
						value: "sku_images",
						failValue: this.$t("express.please_sku_images")
					},
					{
						label: this.$t("express.skc_number"),
						value: "skc_number",
						failValue: this.$t("express.please_item_id")
					},
					{
						label: this.$t("express.sku_nuber"),
						value: "sku_nuber",
						failValue: this.$t("express.please_sku_nuber")
					},
					{
						label: this.$t("express.color"),
						value: "color",
						failValue: this.$t("express.please_color")
					},
					{
						label: this.$t("express.size"),
						value: "size",
						failValue: this.$t("express.please_size")
					},
					{
						label: this.$t("express.material_quality"),
						value: "material_quality",
						failValue: this.$t("express.please_material_quality")
					},
					// {
					// 	label: this.$t("express.goods_number"),
					// 	value: "goods_number",
					// 	failValue: this.$t("express.please_goods_number")
					// },
					{
						label: this.$t("express.goods_number"),
						value: "package_number",
						failValue: this.$t("express.goods_number")
					},
					{
						label: this.type == "into" ?
							this.$t("express.ctime.intoCtime") : this.$t("express.ctime.outCtime"),
						value: "ctime",
						failValue: this.type == "into" ?
							this.$t("express.ctime.please_intoCtime") : this.$t("express.ctime.please_outCtime")
					}
				],
				standing: 0,
			}
		},
		created() {
			this.standing = uni.getStorageSync("standing")

			this.itemList = this.itemList.map(item => {
				for (let key in this.orderData) {
					if (item.value == key) {
						return item
					}
				}
			})
			console.log(this.itemList, 'itemList');
			console.log(this.aimType, 'this.aimType')
			console.log((this.standing == 2 || this.standing == 3), 'this.standing')
			console.log(this.type, 'this.type')
			console.log(!((this.standing == 2 || this.standing == 3) && this.type == 'out' && (this.aimType == 3 || this
				.aimType == 2)), 'flag')
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		padding: 0 34rpx;
	}

	.content .item:last-child {
		border: none;
	}

	.item {
		height: 124rpx;
		display: flex;
		align-items: center;
		border-bottom: 1rpx solid #DFE1E6;
		font-size: 32rpx;
	}

	.item-title {
		color: #15161A;
		width: 200rpx;
		font-weight: 700;
	}

	.item-rig {
		flex: 1;
	}

	.item-img {
		width: 80rpx;
		height: 80rpx;
		margin-right: 8rpx;
	}

	.item-tag {
		color: #6a6a6a;
	}
</style>